﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SettlementTypeManage.aspx.cs" Inherits="weba.Sales.SettlementTypeManage" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
          <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td height="30" background="../Images/tab_05.gif">
                                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td width="12" height="30">
                                            <img src="../Images/tab_03.gif" width="12" height="30" />
                                        </td>
                                        <td>
                                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                <tr>
                                                    <td width="46%" valign="middle">
                                                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                            <tr>
                                                                <td>
                                                                    <div align="center">
                                                                        <img src="../images/tb.gif" width="16" height="16" /></div>
                                                                </td>
                                                                <td width="95%">
                                                                    <span class="titleBold12px">账户管理</span>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </td>
                                                    <td width="54%">
                                                        <!--
                                            <table border="0" align="right" cellpadding="0" cellspacing="0">
                                                <tr>
                                                    <td width="60">
                                                        <table width="87%" border="0" cellpadding="0" cellspacing="0">
                                                            <tr>
                                                                <td >
                                                                    <div align="center">
                                                                        <input type="checkbox" name="checkbox62" value="checkbox" />
                                                                    </div>
                                                                </td>
                                                                <td >
                                                                    <div align="center">
                                                                        全选</div>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </td>
                                                    <td width="60">
                                                        <table width="90%" border="0" cellpadding="0" cellspacing="0">
                                                            <tr>
                                                                <td >
                                                                    <div align="center">
                                                                        <img src="../images/add.gif" width="14" height="14" /></div>
                                                                </td>
                                                                <td >
                                                                    <div align="center">
                                                                        新增</div>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </td>
                                                    <td width="52">
                                                        <table width="88%" border="0" cellpadding="0" cellspacing="0">
                                                            <tr>
                                                                <td >
                                                                    <div align="center">
                                                                        <img src="../images/delete.gif" width="14" height="14" /></div>
                                                                </td>
                                                                <td >
                                                                    <div align="center">
                                                                        删除</div>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </td>
                                                </tr>
                                            </table>
                                            -->
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                        <td width="16" height="30">
                                            <img src="../Images/tab_07.gif" width="16" height="30" />
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td width="8" background="../images/tab_12.gif">
                                            &nbsp;
                                        </td>
                                        <td align="center">
                                            <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
                                                <tr>
                                                    <td width="100" height="30" align="right">
                                                        类型：
                                                    </td>
                                                    <td align="left">
                                                        <asp:RadioButtonList ID="rbtnlFlag" runat="server" RepeatDirection="Horizontal" 
                                                            RepeatLayout="Flow" ValidationGroup="val">
                                                            <asp:ListItem Value="1">支出</asp:ListItem>
                                                            <asp:ListItem Value="2">收入</asp:ListItem>
                                                        </asp:RadioButtonList>
                                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
                                                            ControlToValidate="rbtnlFlag" Display="Dynamic" ErrorMessage="请选择类型" 
                                                            SetFocusOnError="True" ValidationGroup="val"></asp:RequiredFieldValidator>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="100" height="30" align="right">
                                                        收支类别名称：</td>
                                                    <td align="left">
                                                        <asp:TextBox ID="txtName" runat="server"></asp:TextBox>
                                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtName"
                                                            ErrorMessage="请输入类别名称" ValidationGroup="val" Display="Dynamic"></asp:RequiredFieldValidator>
                                                        <asp:CustomValidator ID="CustomValidator1" runat="server" ControlToValidate="txtName"
                                                            Display="Dynamic" ErrorMessage="已存在此名称，请输入其他名称" OnServerValidate="CustomValidator1_ServerValidate"
                                                            ValidationGroup="val"></asp:CustomValidator>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="100" height="30" align="right">
                                                        说明：
                                                    </td>
                                                    <td align="left">
                                                        请不要删除前四项类别。收支类别为系统共享数据，请不要随意删除有用的信息，以免影响其他店面操作。</td>
                                                </tr>
                                                <tr>
                                                    <td width="100" height="30" align="right">
                                                        &nbsp;
                                                        <br />
                                                    </td>
                                                    <td align="center">
                                                        <asp:Label ID="lblMsg" runat="server" ForeColor="Red" Visible="False"></asp:Label>
                                                        <br />
                                                        <asp:Button ID="btnAdd" runat="server" Text="添加" OnClick="btnAdd_Click" ValidationGroup="val" 
                                                        Font-Size="16px" Height="30px" Width="100px"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="100" height="30" align="right">
                                                        &nbsp;
                                                        <br />
                                                    </td>
                                                    <td align="right">
                                                        <asp:Label ID="lblStrWhere" runat="server" Visible="False"></asp:Label>
                                                        类型：<asp:DropDownList ID="ddlFlag" runat="server" AutoPostBack="True" 
                                                            onselectedindexchanged="ddlType_SelectedIndexChanged">
                                                            <asp:ListItem Value="1">支出</asp:ListItem>
                                                            <asp:ListItem Value="2">收入</asp:ListItem>
                                                            <asp:ListItem Selected="True" Value="0">不限</asp:ListItem>
                                            </asp:DropDownList>
                                                    </td>
                                                </tr>
                                            </table>
                                            
                                            <br />
                                            <asp:GridView ID="myGridView" runat="server" AutoGenerateColumns="False" Width="98%"
                                                DataKeyNames="TypeID,Name,Flag" OnRowCancelingEdit="myGridView_RowCancelingEdit"
                                                OnRowDataBound="myGridView_RowDataBound" OnRowDeleting="myGridView_RowDeleting"
                                                OnRowEditing="myGridView_RowEditing" OnRowUpdating="myGridView_RowUpdating">
                                                <Columns>
                                                    <asp:BoundField DataField="TypeID" HeaderText="ID" ReadOnly="True">
                                                        <ItemStyle Width="60px" />
                                                    </asp:BoundField>
                                                    <asp:TemplateField HeaderText="类别名称">
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblName" runat="server" Text='<%# Bind("Name") %>'></asp:Label>
                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="txtName" runat="server" Text='<%# Bind("Name") %>'></asp:TextBox>
                                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtName"
                                                                ErrorMessage="请输入类别名称" ValidationGroup="edit" Display="Dynamic" 
                                                                ForeColor="White"></asp:RequiredFieldValidator>
                                                            <asp:CustomValidator ID="CustomValidator1" runat="server" 
                                                                ControlToValidate="txtName" Display="Dynamic" ErrorMessage="已存在此名称，请输入其他名称" 
                                                                ForeColor="White" OnServerValidate="CustomValidator1_ServerValidate1" 
                                                                SetFocusOnError="True" ValidationGroup="edit"></asp:CustomValidator>
                                                        </EditItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="类型">
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblFlag" runat="server"></asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="编辑" ShowHeader="False">
                                                        <ItemTemplate>
                                                            <asp:LinkButton ID="lbtnEdit" runat="server" CausesValidation="False" 
                                                                CommandName="Edit" Text="编辑"></asp:LinkButton>
                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <asp:LinkButton ID="lbtnUpdate" runat="server" CausesValidation="True" 
                                                                CommandName="Update" Text="更新"></asp:LinkButton>
                                                            &nbsp;<asp:LinkButton ID="lbtnCancelEdit" runat="server" CausesValidation="False" 
                                                                CommandName="Cancel" Text="取消"></asp:LinkButton>
                                                        </EditItemTemplate>
                                                        <ItemStyle Width="60px" />
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="删除" ShowHeader="False">
                                                        <ItemTemplate>
                                                            <asp:LinkButton ID="lbtnDel" runat="server" CausesValidation="False" CommandName="Delete"
                                                                OnClientClick="return confirm(&quot;您确认删除此记录吗？删除后将无法恢复&quot;)" Text="删除"></asp:LinkButton>
                                                        </ItemTemplate>
                                                        <ItemStyle Width="60px" />
                                                    </asp:TemplateField>
                                                </Columns>
                                            </asp:GridView>
                                        </td>
                                        <td width="8" background="../images/tab_15.gif">
                                            &nbsp;
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td height="35" background="../images/tab_19.gif">
                                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td width="12" height="35">
                                            <img src="../images/tab_18.gif" width="12" height="35" />
                                        </td>
                                        <td align="center">
                                            &nbsp;
                                        </td>
                                        <td width="16">
                                            <img src="../images/tab_20.gif" width="16" height="35" />
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                </ContentTemplate>
            </asp:UpdatePanel>
    </div>
    </form>
</body>
</html>
